﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Drawing;

namespace Date
{
    public partial class MasterPage : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            // Check in the session of "loggedIn" is true.
            if (Session["LoggedIn"] != null)
            {
                bool log = (bool)Session["LoggedIn"];
                if (log)
                {
                    // If this is oke. Create Menu
                    Table menu = new Table();
                    TableRow row = new TableRow();
                    menu.Rows.Add(row);
                    // First Link
                    TableCell cell = new TableCell();
                    row.Cells.Add(cell);
                    HyperLink link = new HyperLink();
                    link.Text = "Report groep 8";
                    link.NavigateUrl = "Report.aspx?reportID=8";
                    cell.Controls.Add(link);
                    // Second Link
                    TableCell ce = new TableCell();
                    row.Cells.Add(ce);
                    link = new HyperLink();
                    link.Text = "Report groep 7";
                    link.NavigateUrl = "Report.aspx?reportID=7";
                    ce.Controls.Add(link);
                    // Third link
                    TableCell cel = new TableCell();
                    row.Cells.Add(cel);
                    link = new HyperLink();
                    link.Text = "Report groep 6";
                    link.NavigateUrl = "Report.aspx?reportID=6";
                    cel.Controls.Add(link);

                    PanelNav.Controls.Add(menu);
                }
            }                     
        }
    }
}
